﻿<?php
$sql = "SELECT * FROM LienLac LIMIT 0, 1";

mysql_query("SET character_set_results=utf8");

$MaLL = $_REQUEST['MaLL'];
if(isset($MaLL))
{
	$sql = "SELECT * FROM LienLac WHERE MaLL='$MaLL'";
}

$rows = mysql_query($sql);
while($row = mysql_fetch_array($rows))
{
	$TenLL = $row['TenLL'];
	$Email = $row['Email'];
	$DiaChi = $row['DiaChi'];
	$DienThoai = $row['DienThoai'];
	$SoFax = $row['SoFax'];
	$MaLL = $row['MaLL'];
	$Hinh = $row['Hinh'];
	$KinhTuyen = $row['KinhTuyen'];
	$ViTuyen = $row['ViTuyen'];
	$Zoom = $row['Zoom'];
}
?>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

<script type="text/javascript">
    var map;
    
    function initialize() 
    {
    	var lng = <?php echo $ViTuyen?>;	//106.68489587886052;
	    var lat = <?php echo $KinhTuyen?>;	//10.779440989867943;
	    var zoom = <?php echo $Zoom?>;		//16;
    
        var myLatlng = new google.maps.LatLng(lat, lng);
        var myOptions =
		{
		    zoom: zoom,
		    center: myLatlng,
		    mapTypeId: google.maps.MapTypeId.ROADMAP
		}
        map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
        var marker = new google.maps.Marker(
		{
		    position: myLatlng,
		    map: map
		});

        var infowindow = new google.maps.InfoWindow({
            content: $("#InfoWindowContent").html()
        });

        infowindow.open(map, marker);
    }
    window.onload = initialize;
</script>

<style type="text/css">
#map_canvas
{
	position: relative;
	width: 450px;
	height: 450px;
	margin: 0px auto;
}
</style>

<div id="map_canvas"></div>
<div class="clean10"></div> 
    <table width="80%" border="0" style="margin-left:30px">
    <tr>
    <?php
$sql = "SELECT * FROM LienLac";
$rows = mysql_query($sql);
while($row = mysql_fetch_array($rows))
{
	$MaLL = $row['MaLL'];
	$TenLL = $row['TenLL'];
	$DiaChi = $row['DiaChi'];
	$Email = $row['Email'];
	$DienThoai = $row['DienThoai'];
	$SoFax = $row['SoFax'];
	
	echo'<td>
		<p><b>'.$TenLL.'</b><br />
		'.$DiaChi.'<br />
		Email: '.$Email.'<br />
		Phone: '.$DienThoai.' <br />
		Fax: '.$SoFax.' <br />
		<a href="?p=ContactUs&MaLL='.$MaLL.'">Google Map</a></p></td>
	';///echo
}
?>
  </tr>
</table>

	
<div id="InfoWindowContent" style="display:none">
<img src="hinh/LienLac/<?php echo $Hinh?>" width="150"/>
	<table cellpadding="5">
	<tr>
		<td>
			<li><?php echo $DiaChi?></li>
			<li><?php echo $DienThoai?></li>
		</td>
	</tr>
	</table>
</div>